package cn.edu.lzu.service.impl;

import cn.edu.lzu.common.assist.ResponseResult;
import cn.edu.lzu.dao.FillMedItemMapper;
import cn.edu.lzu.entity.FillMedItem;
import cn.edu.lzu.service.FillMedItemService;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;
import java.sql.Timestamp;

/**
 * @PackageName: cn.edu.lzu.service.impl
 * @ClassName: FillMedItemServiceImpl
 * @Description: TODO
 * @Author: 张琦[QQ:3098086691]
 * @Date: 2020/4/10 19:08
 * @Version: 1.0
 */
@Service
@Transactional
public class FillMedItemServiceImpl implements FillMedItemService {
    @Resource
    private FillMedItemMapper fillMedItemMapper;

    @Override
    public ResponseResult fillMedItemValue(FillMedItem fillMedItem) {
        fillMedItem.setExamineTime(new Timestamp(System.currentTimeMillis()));
        int result=fillMedItemMapper.updMedItemStatusFilled(fillMedItem);
        ResponseResult responseResult=new ResponseResult();
        if(result==1){
            responseResult.setCode(1);
            responseResult.setMsg("数据写入成功！");
        }else{
            responseResult.setCode(0);
            responseResult.setMsg("数据写入失败");
        }
        return responseResult;
    }
}
